//
//  BHHTTPNetStateManager.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/7/12.
//  网络状态监听

import UIKit
import Alamofire

class BHHTTPNetStateManager: NSObject {
    
    static let shared = BHHTTPNetStateManager.init()

    // 有网还是没网  1有网 0没网
    var linkState: Int = 1
    
    override init() {
        super.init()
        
        let manager = NetworkReachabilityManager.init()
        manager?.startListening(onUpdatePerforming: { (state) in
            if state == .notReachable || state == .unknown {
                self.linkState = 0
            }else {
                self.linkState = 1
            }
        })
    }
}
